3.364 \(\int \frac{\tan ^3(e+f x)}{(a+b \sec ^2(e+f x))^3} \, dx\)

Optimal. Leaf size=81 \[ -\frac{b (a+b)}{4 a^3 f \left (a \cos ^2(e+f x)+b\right )^2}+\frac{a+2 b}{2 a^3 f \left (a \cos ^2(e+f x)+b\right )}+\frac{\log \left (a \cos ^2(e+f x)+b\right )}{2 a^3 f} \]

[Out]

-(b*(a + b))/(4*a^3*f*(b + a*Cos[e + f*x]^2)^2) + (a + 2*b)/(2*a^3*f*(b + a*Cos[e + f*x]^2)) + Log[b + a*Cos[e
 + f*x]^2]/(2*a^3*f)

________________________________________________________________________________________

Rubi [A]  time = 0.111637, antiderivative size = 81, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {4138, 446, 77} \[ -\frac{b (a+b)}{4 a^3 f \left (a \cos ^2(e+f x)+b\right )^2}+\frac{a+2 b}{2 a^3 f \left (a \cos ^2(e+f x)+b\right )}+\frac{\log \left (a \cos ^2(e+f x)+b\right )}{2 a^3 f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^3/(a + b*Sec[e + f*x]^2)^3,x]

[Out]

-(b*(a + b))/(4*a^3*f*(b + a*Cos[e + f*x]^2)^2) + (a + 2*b)/(2*a^3*f*(b + a*Cos[e + f*x]^2)) + Log[b + a*Cos[e
 + f*x]^2]/(2*a^3*f)

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin{align*} \int \frac{\tan ^3(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{x^3 \left (1-x^2\right )}{\left (b+a x^2\right )^3} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{(1-x) x}{(b+a x)^3} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (-\frac{b (a+b)}{a^2 (b+a x)^3}+\frac{a+2 b}{a^2 (b+a x)^2}-\frac{1}{a^2 (b+a x)}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{b (a+b)}{4 a^3 f \left (b+a \cos ^2(e+f x)\right )^2}+\frac{a+2 b}{2 a^3 f \left (b+a \cos ^2(e+f x)\right )}+\frac{\log \left (b+a \cos ^2(e+f x)\right )}{2 a^3 f}\\ \end{align*}

Mathematica [A]  time = 0.935679, size = 131, normalized size = 1.62 \[ \frac{2 \left (a^2+3 a b+3 b^2\right )+a^2 \cos ^2(2 (e+f x)) \log (a \cos (2 (e+f x))+a+2 b)+(a+2 b)^2 \log (a \cos (2 (e+f x))+a+2 b)+2 a (a+2 b) \cos (2 (e+f x)) (\log (a \cos (2 (e+f x))+a+2 b)+1)}{2 a^3 f (a \cos (2 (e+f x))+a+2 b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^3/(a + b*Sec[e + f*x]^2)^3,x]

[Out]

(2*(a^2 + 3*a*b + 3*b^2) + (a + 2*b)^2*Log[a + 2*b + a*Cos[2*(e + f*x)]] + a^2*Cos[2*(e + f*x)]^2*Log[a + 2*b
+ a*Cos[2*(e + f*x)]] + 2*a*(a + 2*b)*Cos[2*(e + f*x)]*(1 + Log[a + 2*b + a*Cos[2*(e + f*x)]]))/(2*a^3*f*(a +
2*b + a*Cos[2*(e + f*x)])^2)

________________________________________________________________________________________

Maple [A]  time = 0.083, size = 115, normalized size = 1.4 \begin{align*}{\frac{\ln \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,{a}^{3}f}}+{\frac{1}{2\,f{a}^{2} \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }}+{\frac{b}{{a}^{3}f \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{b}{4\,f{a}^{2} \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) ^{2}}}-{\frac{{b}^{2}}{4\,{a}^{3}f \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^3/(a+b*sec(f*x+e)^2)^3,x)

[Out]

1/2*ln(b+a*cos(f*x+e)^2)/a^3/f+1/2/f/a^2/(b+a*cos(f*x+e)^2)+b/a^3/f/(b+a*cos(f*x+e)^2)-1/4/f/a^2/(b+a*cos(f*x+
e)^2)^2*b-1/4*b^2/a^3/f/(b+a*cos(f*x+e)^2)^2

________________________________________________________________________________________

Maxima [A]  time = 0.996037, size = 153, normalized size = 1.89 \begin{align*} -\frac{\frac{2 \,{\left (a^{2} + 2 \, a b\right )} \sin \left (f x + e\right )^{2} - 2 \, a^{2} - 5 \, a b - 3 \, b^{2}}{a^{5} \sin \left (f x + e\right )^{4} + a^{5} + 2 \, a^{4} b + a^{3} b^{2} - 2 \,{\left (a^{5} + a^{4} b\right )} \sin \left (f x + e\right )^{2}} - \frac{2 \, \log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{a^{3}}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*sec(f*x+e)^2)^3,x, algorithm="maxima")

[Out]

-1/4*((2*(a^2 + 2*a*b)*sin(f*x + e)^2 - 2*a^2 - 5*a*b - 3*b^2)/(a^5*sin(f*x + e)^4 + a^5 + 2*a^4*b + a^3*b^2 -
 2*(a^5 + a^4*b)*sin(f*x + e)^2) - 2*log(a*sin(f*x + e)^2 - a - b)/a^3)/f

________________________________________________________________________________________

Fricas [A]  time = 0.571272, size = 262, normalized size = 3.23 \begin{align*} \frac{2 \,{\left (a^{2} + 2 \, a b\right )} \cos \left (f x + e\right )^{2} + a b + 3 \, b^{2} + 2 \,{\left (a^{2} \cos \left (f x + e\right )^{4} + 2 \, a b \cos \left (f x + e\right )^{2} + b^{2}\right )} \log \left (a \cos \left (f x + e\right )^{2} + b\right )}{4 \,{\left (a^{5} f \cos \left (f x + e\right )^{4} + 2 \, a^{4} b f \cos \left (f x + e\right )^{2} + a^{3} b^{2} f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*sec(f*x+e)^2)^3,x, algorithm="fricas")

[Out]

1/4*(2*(a^2 + 2*a*b)*cos(f*x + e)^2 + a*b + 3*b^2 + 2*(a^2*cos(f*x + e)^4 + 2*a*b*cos(f*x + e)^2 + b^2)*log(a*
cos(f*x + e)^2 + b))/(a^5*f*cos(f*x + e)^4 + 2*a^4*b*f*cos(f*x + e)^2 + a^3*b^2*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**3/(a+b*sec(f*x+e)**2)**3,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.99435, size = 952, normalized size = 11.75 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*sec(f*x+e)^2)^3,x, algorithm="giac")

[Out]

-1/4*((3*a^3 + 9*a^2*b + 9*a*b^2 + 3*b^3 + 20*a^3*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 28*a^2*b*(cos(f*x +
e) - 1)/(cos(f*x + e) + 1) - 4*a*b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 12*b^3*(cos(f*x + e) - 1)/(cos(f*
x + e) + 1) + 34*a^3*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 22*a^2*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) +
 1)^2 - 10*a*b^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 18*b^3*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2
+ 20*a^3*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3 + 28*a^2*b*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3 - 4*a*
b^2*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3 - 12*b^3*(cos(f*x + e) - 1)^3/(cos(f*x + e) + 1)^3 + 3*a^3*(cos(
f*x + e) - 1)^4/(cos(f*x + e) + 1)^4 + 9*a^2*b*(cos(f*x + e) - 1)^4/(cos(f*x + e) + 1)^4 + 9*a*b^2*(cos(f*x +
e) - 1)^4/(cos(f*x + e) + 1)^4 + 3*b^3*(cos(f*x + e) - 1)^4/(cos(f*x + e) + 1)^4)/((a^4 + a^3*b)*(a + b + 2*a*
(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x + e) - 1)^2/(co
s(f*x + e) + 1)^2 + b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)^2) - 2*log(a + b + 2*a*(cos(f*x + e) - 1)/(co
s(f*x + e) + 1) - 2*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + b*
(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/a^3 + 4*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)/a^3)/f